//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop
#include "dm_Kiloutou.h"
#include "VerifMaBase.h"
#include "SplashScreen.h"

USERES("Project1.res");
USEFORM("uSKiloutou.cpp", uEcran);
USEUNIT("CKiloutouClient.cpp");
USEFORM("dm_Kiloutou.cpp", dmKiloutou); /* TDataModule: File Type */
USEUNIT("CLocation.cpp");
USEUNIT("CKiloutouMachine.cpp");
USEUNIT("CCamion.cpp");
USEUNIT("CPelleteuse.cpp");
USEUNIT("CTondeuse.cpp");
USEFORM("vCamion.cpp", vSCamion);
USEFORM("vPelleteuse.cpp", vSPelleteuse);
USEFORM("vSaisieType.cpp", vSType);
USEFORM("vTondeuse.cpp", vSTondeuse);
USEFORM("CStatistique.cpp", vAStatistiques);
USEUNIT("VerifMaBase.cpp");
USEFORM("SplashScreen.cpp", Splash);
USEFORM("About.cpp", vAAbout);
USEFORM("WebKiloutou.cpp", vASiteKiloutou);
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
    try
    {

         TSplash* Splash = NULL;
         Splash = new TSplash(NULL);
         Splash->Show();
         Splash->Repaint();
         Sleep(2000);
         Splash->Visible = false;
         CVerifMaBase MaBaseKiloutou;
         Application->Initialize();
         if(MaBaseKiloutou.VerifierTables()) {
             Application->CreateForm(__classid(TdmKiloutou), &dmKiloutou);
             Application->CreateForm(__classid(TuEcran), &uEcran);
             Application->Run();
         }
         else
            ShowMessage("Erreur dans la base, relancer l'application");
         if(Splash) {delete Splash; Splash = NULL;}
    }
    catch (Exception &exception)
    {
         Application->ShowException(&exception);
    }
    return 0;
}
//---------------------------------------------------------------------------
